package com.mingtu.guards.room;

import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.Query;
import androidx.room.Update;

import java.util.List;

/**
 * @ClassName :
 * @Author : wkk
 * @Date : 2022-8-3 17:39:02
 * @Email : 1281573890@qq.com
 * @Eescription :
 */
@Dao
public interface SignInEventDao {

    @Insert
    void insertEvent(SignInEvent... SignInEvents);

    @Update
    int updateEvent(SignInEvent... SignInEvents);

    @Delete
    void deleteEvent(SignInEvent... SignInEvents);

    @Query("SELECT * FROM SignInEvent WHERE id  = (:id) ")
    SignInEvent getSignInEvent(int id);

    @Query("DELETE  FROM SignInEvent WHERE id  = (:id)")
    void deleteEvent(int id);

    @Query("SELECT * FROM SignInEvent ORDER BY ID DESC")
    List<SignInEvent> getAll();

    @Query("DELETE FROM SignInEvent")
    void removeAll();

}
